#时间计算
a=int(input())
b=int(input())
c=int(input())
print(f'{a:02}:{b:02}:{c:02}')
seconds_to_midnight=(24*60*60-(a*60*60+b*60+c))
print(f'距离午夜还剩余{seconds_to_midnight}秒')